package cn.cboard.model;

import java.util.Collection;
import java.util.Date;

@SuppressWarnings("unchecked")
public class ForumTopic implements java.io.Serializable{

	private static final long serialVersionUID = 650367151203810811L;
	private Long topicId;
    private Date creationDate;
    private Date modifiedDate;
    
    private String subject;    
    private String filteredSubject;    

    private String content;
    private String filteredContent;
   
    private User user;    
    private ForumThread forumThread;
    private Forum forum;
    
    //for upload files
    private Collection uploadFiles;    


	public Long getTopicId() {
		return topicId;
	}

	public void setTopicId(Long topicId) {
		this.topicId = topicId;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getFilteredSubject() {
		if (this.filteredSubject != null)
			   return this.filteredSubject;
			else
			   return this.subject;
	}

	public void setFilteredSubject(String filteredSubject) {
		this.filteredSubject = filteredSubject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getFilteredContent() {
    	if (this.filteredContent != null)
  		  return this.filteredContent;
      	else
      	  return content;
	}

	public void setFilteredContent(String filteredContent) {
		this.filteredContent = filteredContent;
	}

	public ForumThread getForumThread() {
		return forumThread;
	}

	public void setForumThread(ForumThread forumThread) {
		this.forumThread = forumThread;
	}
    
	public Collection getUploadFiles() {
		return uploadFiles;
	}

	public void setUploadFiles(Collection uploadFiles) {
		this.uploadFiles = uploadFiles;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	public Forum getForum() {
		return forum;
	}

	public void setForum(Forum forum) {
		this.forum = forum;
	}
	
	public String toString(){
		return subject;
	}

}
